package com.aspose.cells;

class zcdd {
   private int b;
   private byte[] c;
   private int d;
   private zbxz e;
   zoz a;
   private Workbook f;
   private zazv g;

   zcdd(zoz var1) {
      this.a = var1;
      this.f = var1.a;
   }

   zbaa a() {
      zbaa var1 = new zbaa();
      byte var2 = 4;
      var1.b = com.aspose.cells.b.a.zc.a(this.c, var2);
      int var3 = var2 + 4;
      var1.c = com.aspose.cells.b.a.zc.b(this.c, var3);
      var3 += 2;
      var1.d = (this.c[var3] & 255 & 1) != 0;
      var1.e = (this.c[var3] & 255 & 2) != 0;
      var3 += 2;
      var1.h = com.aspose.cells.b.a.zc.b(this.c, var3);
      var3 += 2;
      return var1;
   }

   void a(zbxz var1, zazv var2) throws Exception {
      this.e = var1;
      this.g = var2;

      while(true) {
         this.b = var1.a();
         switch(this.b) {
         case 403:
            this.d = var1.b();
            var1.a((long)this.d);
            return;
         case 404:
         case 406:
         case 408:
         case 410:
         case 411:
         case 417:
         case 420:
         default:
            this.d = var1.b();
            var1.a((long)this.d);
            break;
         case 405:
            var2.c.a(this.i());
            break;
         case 407:
            var2.c.a(this.j());
            break;
         case 409:
            zazh var3 = this.k();
            if (var3 != null) {
               var2.c.a(var3);
            }
            break;
         case 412:
            var2.c.a(this.h());
            break;
         case 413:
            var2.c.a(this.f());
            break;
         case 414:
            var2.c.a(this.g());
            break;
         case 415:
            var2.c.a(this.e());
            break;
         case 416:
            var2.c.a(this.d());
            break;
         case 418:
            var2.c.a(this.m());
            break;
         case 419:
            var2.c.a(this.l());
            break;
         case 421:
            var2.c.a(this.c());
         }
      }
   }

   private zazh m() {
      zazz var1 = new zazz();
      this.c = this.e.d();
      zbaa var2 = this.a();
      var1.d = var2.h;
      var1.e = var2.b;
      byte var3 = 14;
      var1.c = zcch.a(this.c, var3);
      int var4 = var3 + 16;
      var1.b = com.aspose.cells.b.a.zc.a(this.c, var4);
      return var1;
   }

   zazh b() throws Exception {
      zbad var1 = new zbad();
      this.c = this.e.d();
      byte var2 = 0;
      var1.e = com.aspose.cells.b.a.zc.e(this.c, var2) & '\uffff';
      int var3 = var2 + 2;
      var1.b = this.c[var3];
      ++var3;
      var1.f = (this.c[var3] & 255 & 1) != 0;
      var1.g = (this.c[var3] & 255 & 2) != 0;
      ++var3;
      var3 += 5;
      var1.d = zcch.a(this.c, var3);
      var3 += 16;
      var1.h = com.aspose.cells.b.a.zc.a(this.c, var3);
      var3 += 4;
      var1.i = com.aspose.cells.b.a.zc.a(this.c, var3);
      var3 += 4;
      var1.j = com.aspose.cells.b.a.zc.b(this.c, var3);
      var3 += 2;
      if (var1.f) {
         var1.c = zcch.d(this.c, var3);
      }

      return var1;
   }

   zazh c() {
      zazi var1 = new zazi();
      this.c = this.e.d();
      zbaa var2 = this.a();
      var1.e = var2.h;
      byte var3 = 14;
      var1.c = com.aspose.cells.b.a.zc.a(this.c, var3);
      int var4 = var3 + 4;
      var1.b = com.aspose.cells.b.a.zc.a(this.c, var4);
      var4 += 4;
      var1.d = zcch.a(this.c, var4);
      return var1;
   }

   zazh d() throws Exception {
      zazk var1 = new zazk();
      this.c = this.e.d();
      zbaa var2 = this.a();
      var1.m = var2.h;
      byte var3 = 14;
      var1.f = com.aspose.cells.b.a.zc.a(this.c, var3);
      var1.g = com.aspose.cells.b.a.zc.a(this.c, var3 + 4);
      int var4 = var3 + 8;
      if ((this.c[var4] & 255 & 1) != 0) {
         var1.b = 0;
      }

      if ((this.c[var4] & 255 & 2) != 0) {
         var1.b = 1;
      }

      var4 += 2;
      var1.c = (this.c[var4] & 255 & 2) != 0;
      var1.h = (this.c[var4] & 255 & 128) != 0;
      var1.i = (this.c[var4 + 1] & 255 & 1) != 0;
      var4 += 2;
      var1.e = new byte[16];
      System.arraycopy(this.c, var4, var1.e, 0, 16);
      var4 += 16;
      var1.l = com.aspose.cells.b.a.zc.a(this.c, var4);
      var4 += 4;
      var1.j = com.aspose.cells.b.a.zc.a(this.c, var4) + var1.l;
      var4 += 4;
      var1.d = zcch.d(this.c, var4);
      return var1;
   }

   zazh e() throws Exception {
      zazp var1 = new zazp();
      this.c = this.e.d();
      zbaa var2 = this.a();
      var1.B = var2.b;
      var1.A = var2.d;
      var1.z = var2.e;
      var1.b = var2.c == 34;
      byte var3 = 14;
      var1.v = com.aspose.cells.b.a.zc.b(this.c, var3);
      int var6 = var3 + 2;
      var1.p = (this.c[var6] & 255 & 1) != 0;
      var1.q = (this.c[var6] & 255 & 2) != 0;
      ++var6;
      var6 += 2;
      var1.r = (this.c[var6] & 255 & 2) != 0;
      var1.a((byte)((this.c[var6] & 255) >> 2));
      var1.c(this.c[var6 + 1]);
      var6 += 2;
      short var4 = com.aspose.cells.b.a.zc.b(this.c, var6);
      var6 += 2;
      var1.t = (var4 & 1) != 0;
      var6 += 2;
      var1.s = (this.c[var6] & 255 & 2) != 0;
      var1.b((byte)((this.c[var6] & 255) >> 2));
      var1.d(this.c[var6 + 1]);
      var6 += 2;
      short var5 = com.aspose.cells.b.a.zc.b(this.c, var6);
      var6 += 2;
      var1.u = (var5 & 1) != 0;
      var6 += 8;
      var1.w = zcch.d(this.c, var6);
      var6 += 4 + var1.w.length() * 2;
      var1.d = a(this.c, var6);
      var6 += var1.d.length;
      var1.j = zcch.d(this.c, var6);
      var6 += 4;
      if (var1.j != null) {
         var6 += var1.j.length() * 2;
      }

      var1.l = zcch.d(this.c, var6);
      var6 += 4;
      if (var1.l != null) {
         var6 += var1.l.length() * 2;
      }

      var1.n = zcch.d(this.c, var6);
      var6 += 4;
      if (var1.n != null) {
         var6 += var1.n.length() * 2;
      }

      var1.x = zcch.d(this.c, var6);
      var6 += 4;
      if (var1.x != null) {
         var6 += var1.x.length() * 2;
      }

      var1.h = zcch.d(this.c, var6);
      var6 += 4;
      if (var1.h != null) {
         var6 += var1.h.length() * 2;
      }

      var1.c = a(this.c, var6);
      var6 += var1.c.length;
      var1.k = zcch.d(this.c, var6);
      var6 += 4;
      if (var1.k != null) {
         var6 += var1.k.length() * 2;
      }

      var1.m = zcch.d(this.c, var6);
      var6 += 4;
      if (var1.m != null) {
         var6 += var1.m.length() * 2;
      }

      var1.o = zcch.d(this.c, var6);
      var6 += 4;
      if (var1.o != null) {
         var6 += var1.o.length() * 2;
      }

      var1.y = zcch.d(this.c, var6);
      var6 += 4;
      if (var1.y != null) {
         var6 += var1.y.length() * 2;
      }

      var1.i = zcch.d(this.c, var6);
      var6 += 4;
      if (var1.i != null) {
         int var10000 = var6 + var1.i.length() * 2;
      }

      return var1;
   }

   private static byte[] a(byte[] var0, int var1) {
      int var2 = com.aspose.cells.b.a.zc.a(var0, var1);
      int var3 = com.aspose.cells.b.a.zc.a(var0, var1 + var2 + 4);
      byte[] var4 = new byte[8 + var2 + var3];
      System.arraycopy(var0, var1, var4, 0, var4.length);
      return var4;
   }

   zazh f() throws Exception {
      zbab var1 = new zbab();
      this.c = this.e.d();
      zbaa var2 = this.a();
      var1.e = var2.b;
      var1.g = var2.d;
      var1.d = var2.e;
      var1.f = var2.h;
      byte var3 = 14;
      var1.c = zcch.d(this.c, var3);
      int var4 = var3 + var1.c.length() * 2 + 4;
      var1.b = zcch.d(this.c, var4);
      int var10000 = var4 + var1.b.length() * 2 + 4;
      return var1;
   }

   zazh g() throws Exception {
      zazu var1 = new zazu();
      this.c = this.e.d();
      zbaa var2 = this.a();
      var1.d = var2.b;
      var1.g = var2.d;
      var1.c = var2.e;
      var1.e = var2.h;
      byte var3 = 14;
      var1.f = com.aspose.cells.b.a.zc.e(this.c, var3) & '\uffff';
      int var4 = var3 + 2;
      var1.b = zcch.d(this.c, var4);
      return var1;
   }

   zazh h() {
      zazo var1 = new zazo();
      this.c = this.e.d();
      zbaa var2 = this.a();
      switch(var2.c) {
      case 43:
         var1.c = 0;
         break;
      case 44:
         var1.c = 1;
         break;
      default:
         var1.c = 0;
      }

      byte var3 = 14;
      var1.b = new byte[16];
      System.arraycopy(this.c, var3, var1.b, 0, 16);
      return var1;
   }

   zazh i() throws Exception {
      zazt var1 = new zazt();
      this.c = this.e.d();
      zbaa var2 = this.a();
      var1.g = var2.b;
      var1.i = var2.d;
      var1.e = var2.e;
      var1.h = var2.h;
      switch(var2.c) {
      case 0:
         var1.b = 5;
         break;
      case 1:
         var1.b = 4;
         break;
      case 2:
         var1.b = 3;
         break;
      case 3:
         var1.b = 2;
      }

      byte var3 = 14;
      var1.d = (this.c[var3] & 255 & 1) != 0;
      int var6 = var3 + 1;
      var1.f = zcch.a(this.c, var6);
      boolean var4 = true;

      while(var4) {
         this.b = this.e.a();
         switch(this.b) {
         case 404:
            var1.b().a(this.b());
            break;
         case 406:
            this.d = this.e.b();
            this.e.a((long)this.d);
            var4 = false;
            break;
         case 409:
            zazh var5 = this.k();
            if (var5 != null) {
               var1.b().a(var5);
            }
            break;
         case 419:
            var1.b().a(this.l());
         }
      }

      return var1;
   }

   zazh j() throws Exception {
      zazm var1 = new zazm();
      this.c = this.e.d();
      zbaa var2 = this.a();
      var2.a(var1);
      byte var3 = 14;
      var1.b = zcch.a(this.c, var3);
      int var6 = var3 + 16;
      var1.c = zcch.a(this.c, var6);
      var6 += 16;
      var1.g = com.aspose.cells.b.a.zc.e(this.c, var6) & '\uffff';
      boolean var4 = true;

      while(var4) {
         this.b = this.e.a();
         switch(this.b) {
         case 404:
            var1.d().a(this.b());
            break;
         case 408:
            this.d = this.e.b();
            this.e.a((long)this.d);
            var4 = false;
            break;
         case 409:
            zazh var5 = this.k();
            if (var5 != null) {
               var1.d().a(var5);
            }
            break;
         case 419:
            var1.d().a(this.l());
         }
      }

      return var1;
   }

   zazh k() throws Exception {
      zazj var1 = new zazj();
      this.c = this.e.d();
      zbaa var2 = this.a();
      var2.a(var1);
      byte var3 = 14;
      int var4 = com.aspose.cells.b.a.zc.a(this.c, var3);
      int var18 = var3 + 4;
      com.aspose.cells.b.a.zc.a(this.c, var18);
      var18 += 4;
      boolean var6 = false;
      int var7 = 0;
      if (var2.c == 8) {
         short var8 = com.aspose.cells.b.a.zc.b(this.c, var18);
         int var9 = a(var8 & 7);
         var7 = a(var8 >> 3 & 7);
         var1.i = (var8 & 64) != 0;
         var1.g = (var8 & 128) != 0;
         var1.c = (var8 & 256) != 0;
         var6 = (var8 & 512) != 0;
         var1.o = (var8 & 1024) != 0;
         var1.l = (var8 & 2048) != 0;
         var1.b = (var8 & 4096) != 0;
         boolean var10 = (var8 & 8192) != 0;
         var18 += 2;
         var1.e = this.c[var18] & 255;
         ++var18;
         var1.f = (this.c[var18] & 255 & 1) != 0;
         var1.h = (this.c[var18] & 255 & 2) != 0;
         var1.d = (this.c[var18] & 255 & 4) != 0;
         boolean var11 = (this.c[var18] & 255 & 8) != 0;
         ++var18;
         com.aspose.cells.b.a.zc.a(this.c, var18);
         var18 += 4;
         if (var18 + 4 <= this.c.length) {
            int var13 = com.aspose.cells.b.a.zc.a(this.c, var18) / 100;
            var18 += 4;
            var1.t = new Font[var13];

            for(int var14 = 0; var14 < var13; ++var14) {
               var1.t[var14] = new Font(this.f.getWorksheets(), (Object)null, false);
               var18 = this.a(var1.t[var14], var18);
            }
         }
      }

      zazl[] var20 = new zazl[2];
      zbac[] var21 = new zbac[2];
      int var22 = 0;
      int var23 = 0;
      Object var12 = null;
      String var25 = null;
      boolean var26 = true;

      while(var26) {
         this.b = this.e.a();
         byte[] var24;
         switch(this.b) {
         case 1:
            this.c = this.e.d();
            if (var22 < 2) {
               var20[var22++] = this.a(var1, this.c, 0, var4, (Object)null, (byte[])null);
            }
            break;
         case 2:
            this.c = this.e.d();
            if (var22 < 2) {
               var20[var22++] = this.a(var1, this.c, 0, var4, zavz.a(this.c, 8), (byte[])null);
            }
            break;
         case 3:
            this.c = this.e.d();
            if (var22 < 2) {
               var20[var22++] = this.a(var1, this.c, 0, var4, zsk.b(this.c[8]), (byte[])null);
            }
            break;
         case 4:
            this.c = this.e.d();
            if (var22 < 2) {
               var20[var22++] = this.a(var1, this.c, 0, var4, this.c[8] != 0 ? zml.d : zml.e, (byte[])null);
            }
            break;
         case 5:
            this.c = this.e.d();
            if (var22 < 2) {
               var20[var22++] = this.a(var1, this.c, 0, var4, com.aspose.cells.b.a.zc.f(this.c, 8), (byte[])null);
            }
            break;
         case 6:
            this.c = this.e.d();
            if (var22 < 2) {
               var20[var22++] = this.a(var1, this.c, 0, var4, zcch.d(this.c, 8), (byte[])null);
            }
            break;
         case 8:
            this.c = this.e.d();
            var3 = 8;
            int[] var16 = new int[]{var3};
            var25 = zcch.a(this.c, var16);
            var18 = var16[0];
            var18 += 2;
            var24 = new byte[this.c.length - 10 - 4 - var25.length() * 2];
            System.arraycopy(this.c, var18, var24, 0, var24.length);
            if (var22 < 2) {
               var20[var22++] = this.a(var1, this.c, 0, var4, var25, var24);
            }
            break;
         case 9:
            this.c = this.e.d();
            var24 = new byte[this.c.length - 18];
            System.arraycopy(this.c, 18, var24, 0, this.c.length - 18);
            if (var22 < 2) {
               var20[var22++] = this.a(var1, this.c, 0, var4, com.aspose.cells.b.a.zc.f(this.c, 8), var24);
            }
            break;
         case 62:
            this.c = this.e.d();
            boolean var19 = true;
            zayy var15 = zcdi.a(this.c, 8, this.a);
            if (var22 < 2) {
               var20[var22++] = this.a(var1, this.c, 0, var4, var15, (byte[])null);
            }
            break;
         case 410:
            this.d = this.e.b();
            this.e.a((long)this.d);
            var26 = false;
            break;
         case 505:
            zbac var17 = this.n();
            if (var23 < 2) {
               var21[var23++] = var17;
            }
            break;
         default:
            this.d = this.e.b();
            this.e.a((long)this.d);
         }
      }

      if (var2.c != 8) {
         return null;
      } else {
         var23 = 0;
         if (var1.c && !var6) {
            var1.r = var21[var23++];
         }

         var1.s = var21[var23];
         var22 = 0;
         if (var7 != 0) {
            var1.p = var20[var22++];
         }

         var1.q = var20[var22];
         return var1;
      }
   }

   zazh l() throws Exception {
      zazq var1 = new zazq();
      this.c = this.e.d();
      zbaa var2 = this.a();
      var1.e = var2.h;
      byte var3 = 14;
      var1.h = (this.c[var3] & 255 & 1) != 0;
      boolean var4 = (this.c[var3] & 255 & 1) != 0;
      var1.d = (this.c[var3] & 255 & 4) != 0;
      int var7 = var3 + 1;
      var1.g = com.aspose.cells.b.a.zc.a(this.c, var7);
      var7 += 4;
      var1.c = com.aspose.cells.b.a.zc.a(this.c, var7);
      if (var1.c == Integer.MAX_VALUE) {
         var1.c = 0;
      }

      var7 += 4;
      var1.f = zcch.b(this.c, var7);
      boolean var5 = true;

      while(var5) {
         this.b = this.e.a();
         switch(this.b) {
         case 420:
            this.d = this.e.b();
            this.e.a((long)this.d);
            var5 = false;
            break;
         case 505:
            zbac var6 = this.n();
            var1.b = var6;
            break;
         default:
            this.d = this.e.b();
            this.e.a((long)this.d);
         }
      }

      return var1;
   }

   private zbac n() throws Exception {
      this.d = this.e.b();
      this.e.a((long)this.d);
      zbac var1 = null;

      while(true) {
         this.b = this.e.a();
         switch(this.b) {
         case 506:
            this.d = this.e.b();
            this.e.a((long)this.d);
            return var1;
         case 507:
            var1 = new zbac();
            this.c = this.e.d();
            zbzl var2 = zcdp.a(this.c, 0, (WorksheetCollection)this.f.getWorksheets());
            var1.c = var2.b;
            var1.b = var2.a;
            break;
         default:
            this.d = this.e.b();
            this.e.a((long)this.d);
         }
      }
   }

   private zazl a(zazh var1, byte[] var2, int var3, int var4, Object var5, byte[] var6) {
      int var7 = com.aspose.cells.b.a.zc.a(var2, var3);
      int var8 = (Integer)this.a.d.get(com.aspose.cells.b.a.zc.a(var2, var3 + 4) & 16777215);
      zazl var9 = new zazl(var1, var4, var7);
      var9.d = var8;
      var9.e = var5;
      var9.h = var6;
      return var9;
   }

   private int a(Font var1, int var2) throws Exception {
      var1.setName(zcch.e(this.c, var2));
      var2 += 64;
      var1.c(com.aspose.cells.b.a.zc.a(this.c, var2));
      var2 += 4;
      var1.setItalic((this.c[var2] & 255 & 2) != 0);
      var1.setStrikeout((this.c[var2] & 255 & 128) != 0);
      var2 += 4;
      var1.b(com.aspose.cells.b.a.zc.b(this.c, var2));
      var2 += 2;
      switch(this.c[var2]) {
      case 1:
         var1.setSuperscript(true);
         break;
      case 2:
         var1.setSubscript(true);
      }

      var2 += 2;
      switch(this.c[var2]) {
      case 1:
         var1.setUnderline(1);
         break;
      case 2:
         var1.setUnderline(2);
         break;
      case 3:
         var1.setUnderline(3);
         break;
      case 4:
         var1.setUnderline(4);
      }

      ++var2;
      var1.a(this.c[var2]);
      ++var2;
      var1.setCharset(this.c[var2]);
      ++var2;
      var2 += 9;
      switch(this.c[var2]) {
      case 1:
         var1.a("Major");
         break;
      case 2:
         var1.a("Minor");
      }

      var2 += 4;
      boolean var3 = false;
      boolean[] var4 = new boolean[]{var3};
      var1.b = zcdp.a(this.c, var2, var4);
      var3 = var4[0];
      var2 += 8;
      return var2;
   }

   static int a(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
      case 2:
         return 1;
      case 3:
         return 4;
      case 4:
         return 2;
      case 5:
         return 5;
      default:
         return 0;
      }
   }
}
